package com.java.testdemo2;

public class Vehicle {
	// 属性
	public static String vehicleName;
	private String vehicleType;
	private Double vehicleSpeed;

	// 构造方法
	public Vehicle(String vehicleName, String vehicleType, Double vehicleSpeed) {
		super();
		this.vehicleName = vehicleName;
		this.vehicleType = vehicleType;
		this.vehicleSpeed = vehicleSpeed;
	}

	public Vehicle() {
		super();

	}

	static {
		System.out.println("使用了静态语句块：");
	}

	// 静态方法
	public static void showMe() {
		System.out.println("This is a " + vehicleName);
		// 静态的只能访问静态的
	}
	// 方法

	public void move() {
		showMe();// 非静态的可以访问静态的
		System.out.println(vehicleName + " is moving...   ");

	}

	public void showMe0() {
		System.out.println("This is a " + vehicleName + " at speed of " + vehicleSpeed);
		// 静态的只能访问静态的
	}

	// getter，setter方法

	public String getVehicleName() {
		return vehicleName;
	}

	public void setVehicleName(String vehicleName) {
		this.vehicleName = vehicleName;
	}

	public String getVehicleType() {
		return vehicleType;
	}

	public void setVehicleType(String vehicleType) {
		this.vehicleType = vehicleType;
	}

	public Double getVehicleSpeed() {
		return vehicleSpeed;
	}

	public void setVehicleSpeed(Double vehicleSpeed) {
		this.vehicleSpeed = vehicleSpeed;
	}

}
